package com.dy.design_pattern_study.abstract_factory_pattern.dome_abstract_factory.dome_simple_factory;

import com.dy.design_pattern_study.abstract_factory_pattern.dome_abstract_factory.IDB.IDepartment;
import com.dy.design_pattern_study.abstract_factory_pattern.dome_abstract_factory.IDB.IUser;
import com.dy.design_pattern_study.abstract_factory_pattern.dome_abstract_factory.IDB.impl.access.AccessDepartment;
import com.dy.design_pattern_study.abstract_factory_pattern.dome_abstract_factory.IDB.impl.access.AccessUser;
import com.dy.design_pattern_study.abstract_factory_pattern.dome_abstract_factory.IDB.impl.sqlServer.SqlserverDepartment;
import com.dy.design_pattern_study.abstract_factory_pattern.dome_abstract_factory.IDB.impl.sqlServer.SqlserverUser;

/**
 * @CreateBy zhangdingyi
 * @Date 2023-04-05
 * @Content 简单工厂改造抽象工厂
 */
public class BaseDBSimple {

    private static String db = "Sqlserver";
    private static String dbA = "Access";

    public static IUser createUser() {
        IUser result = null;
        switch (db) {
            case "Sqlserver":
                result = new SqlserverUser();
            case "Access":
                result = new AccessUser();
        }
        return result;
    }

    public static IDepartment createDepartment() {
        IDepartment result = null;
        switch (db) {
            case "Sqlserver":
                result = new SqlserverDepartment();
            case "Access":
                result = new AccessDepartment();
        }
        return result;
    }
}
